<template>
  <div class="box">
    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="padding: 24px; width: 100%;">
      <el-tab-pane label="全量数据层目录" name="first">
        <totalModel v-if="isbool" ref="totalModel" />
      </el-tab-pane>
      <el-tab-pane label="核心层目录" name="second">
        <coreModel v-if="isbool1" ref="coreModel" />
      </el-tab-pane>
      <el-tab-pane label="主题域目录" name="three">
        <themeModel v-if="isbool2" ref="themeModel" />
      </el-tab-pane>
      <el-tab-pane label="目标数据库目录" name="fore">
        <targetModel v-if="isbool3" ref="targetModel" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import { mapGetters, mapState } from 'vuex'

import themeModel from './coreModel/indexzhuti.vue'
import coreModel from './coreModel/index.vue'
import totalModel from './totalModel/index.vue'
import targetModel from '../../targetModel/index'

export default {
  name: 'ModelINdex',
  components: { coreModel, totalModel, themeModel, targetModel },
  data() {
    return {
      activeName: 'first', //tarbar
      isbool: true,
      isbool1: false,
      isbool2: false,
      isbool3: false,
    }
  },
  created() { },
  computed: {
    ...mapGetters(['sidebar', 'avatar', 'device']),
    ...mapState({
      topMenu: (state) => state.settings.topMenu,
    }),
    avatarUrl() {
      if (this.avatar === undefined) {
        return defaultAvatar
      }
      return this.avatar
    },
  },
  methods: {
    handleClick(tab, event) {
      if (tab.name == "first") {
        this.isbool = true
        this.isbool1 = false
        this.isbool2 = false
        this.isbool3 = false
      } else if (tab.name == "second") {
        this.isbool = false
        this.isbool1 = true
        this.isbool2 = false
        this.isbool3 = false
      } else if (tab.name == "three") {
        this.isbool = false
        this.isbool1 = false
        this.isbool2 = true
        this.isbool3 = false
      } else if (tab.name == "fore") {
        this.isbool = false
        this.isbool1 = false
        this.isbool2 = false
        this.isbool3 = true
      }
    }
  },
}
</script>
<style lang="scss">
#treeBox {
  margin-top: 1px;

  .el-table thead {
    display: none;
  }
}

.el-dialog {
  width: 70% !important;
}

.box {
  width: 100%;
  height: 100%;

  display: flex;
}

.dome_left {
  height: 100%;
}

.dome_right {
  width: 88%;

  height: 100%;
}
</style>